package com.cuit.lotery.controller;

import com.cuit.lotery.entity.Users;
import com.cuit.lotery.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    UsersService usersService;
    @GetMapping("/login")
    public String login(){
        return "login";
    }

    @PostMapping("/doLogin")
    @ResponseBody
    public boolean doLogin(Users users){
        return usersService.userLogin(users);
    }

}
